import 'package:p_location/map/res/user_trace_record_item.dart';

class UserTraceAreaInfo {
  int areaId;
  String areaName;
  List<Record> records;

  //自己添加的
  bool isExpand;

  UserTraceAreaInfo(
      {this.areaId, this.areaName, this.records, this.isExpand = true});

  factory UserTraceAreaInfo.fromJson(Map<String, dynamic> json) {
    return UserTraceAreaInfo(
      areaId: json['areaId'],
      areaName: json['areaName'],
      records: json['records'] != null
          ? (json['records'] as List).map((i) => Record.fromJson(i)).toList()
          : null,
    );
  }

//    Map<String, dynamic> toJson() {
//        final Map<String, dynamic> data = new Map<String, dynamic>();
//        data['areaId'] = this.areaId;
//        data['areaName'] = this.areaName;
//        if (this.records != null) {
//            data['records'] = this.records.map((v) => v.toJson()).toList();
//        }
//        return data;
//    }
}
